<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<title>ComBox</title>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	</head>
	<script type="text/javascript" src="mootools-1.2.1-core-nc.js"></script>
	<script type="text/javascript" src="combox.js"></script>
	<body>
		<h1>ComBox</h1>
		<form action="test.php" method="post" id="combox-form">
		<table>
			<tr>
				<td>
					<select name="vegetables" class="comBox2" id="test">
						<option value='1'>Carrots</option>
						<option value='4' selected>Broccoli</option>
						<option value='7'>Garlic</option>
						<option value='5'>Tomato</option>
						<option value='2'>Peanut</option>
						<option value='3'>Sports</option>
						<option value='6'>Potatos</option>
					</select>
				</td>
				<td>
					<select name="transport" class="comBox2">
						<option value='1'>Car</option>
						<option value='4'>Airplane</option>
						<option value='7' selected>Submarine</option>
						<option value='5'>Balloon</option>
						<option value='2'>Boat</option>
						<option value='3'>Bicycle</option>
					</select>
				</td>
				<td>
					<div class="comBox"></div>
				</td>
				<td>
					<div>
						<div id="for-combox"></div>
					</div>
					<div>
						<div></div>
					</div>
				</td>
				<td id="for-combox2">
				</td>
				<td>
					<input type="button" id="form-submit" value="test">
				</td>	
			</tr>
		</table>
		</form>
		<div id="result-area"></div>
		<script type="text/javascript">
			
			window.addEvent('domready', function(){
			
			    new ComBox($$('.comBox2'));
			    //new ComBox("test");
			    
			    //test.combox();
			});
			$('form-submit').addEvent("click", function(){

				$("result-area").empty();
				$("result-area").appendText($("combox-form").toQueryString());

/*
				var myHTMLRequest = new Request.HTML({
					url:'test.php',
					onComplete:function(data){
						alert(data);
						$('result-area').set("html", data);
					}
				}).post($('form'));*/
			});


			var r = $("for-combox2").combox({
				name:"test2",
				value:"ffffff",
				width:"200px",
				height:"",
				options:[
					{name:"test1",value:"1"},
					{name:"test2",value:"2"},
					{name:"test3",value:"3"},
				]
			});
			
		</script>
		<div class="el"></div>
		<div class="el"></div>
	</body>
</html>
